#ifndef MYDISPLAYWIDGET_H
#define MYDISPLAYWIDGET_H

#include <QWidget>
#include <QColor>
#include <QToolButton>
#include "dataprovider.h"

typedef enum
{
    DisplayX,
    DisplayY,
    DisplayXY,
    DisplayBlock,
    DisplayDetail,
    DisplayBar,
    DisplayDebug,
    DisplayRemind,
    DisplayDiscargeDone
}FiberDisplayMode;

typedef enum{
    DB_LEFT,
    DB_RIGHT,
    DB_STOP,
    DB_NONE    //加这个是因为 线条实时在绘制，所以有三种状态， 向左，向右，停止
}DBKEY;


class MyDisplayWidget : public QWidget
{
    Q_OBJECT
public:
    explicit MyDisplayWidget(QWidget *parent = 0);
    void setDisplayMode(FiberDisplayMode);
    void setMeltDoneInfo();
    void setCaliberateInfo();
    void setFiberData(qreal sm,qreal mm);
    void setDataProvider(DataProvider*);
    void setRemindMsg(QString msg,bool alarmEnable = false);
    void getAuxPos();
    void SetAuxPosString();
    void ShowAuxPos();
    void getBatVal();
    void setMinBatVal();
    void setMaxBatVal();
    void setAdjMode();
    int  getAdjMode();
    void setDBKey(DBKEY direction);
    void setHiddenFunc(int val);
    void setBGTransparent(bool enable);


    QString getRemindMSg();

    void setLanguageTr(QStringList strTrList);

protected:
    void paintEvent(QPaintEvent *);

private:
    DataProvider* dataProvider;
    FiberDisplayMode fiberDisplayMode;




    qreal distX;
    qreal distY;
    qreal fiberCore;
    qreal fiberDiam;
    qreal cutAngleLeft;
    qreal cutAngleRight;
    qreal fiberAngle;
    qreal estimatedLoss;
    qreal cover;
    qreal sm;
    qreal mm;

    int          adjust_mode;
    int          caliberation_info[5];
    unsigned int FiberLeftUpEdgePos;
    unsigned int FiberLeftDownEdgePos;
    unsigned int FiberRightUpEdgePos;
    unsigned int FiberRightDownEdgePos;
    unsigned int FiberCamXBright;
    unsigned int FiberCamYBright;

    QString CamXLightStr;
    QString CamYLightStr;
    QString LeftUpEdgePosStr;
    QString LeftDownEdgePosStr;
    QString RightUpEdgePosStr;
    QString RightDownEdgePosStr;
    QString AdjustString;

    QString RemindMsg;

    QColor bgColorTrans;//透明背景颜色
    QColor gridColorDark;//深色格线颜色
    QColor gridColorLight;//浅色格线颜色
    QColor bgColorCovered;//不透明的背景颜色
    QColor labelBgColor1;//x,y标签的背景颜色
    QColor labelTextColor1;//x，y标签的字体颜色
    QColor lineColorDark;//sm,mm标签的背景颜色
    QColor lineColorLight;//sm,mm标签的字体颜色
    QLinearGradient bgLGradient;


    QString dis_hardwareV;//硬件版本
    QString dis_softwareV;//软件版本
    QString dis_equipmentNumber;//设备编号

    QString dis_dischargeNormal ;//放电正常
    QString dis_dischargeTooStrong;//放电太强
    QString dis_dischargeTooWeak;//放电太弱
    QString dis_fromLeft;//放电偏左
    QString dis_fromRight;//放电偏右
    QString dis_dischargeAnomaly;//放电异常
    QString dis_positionAdjustment;//位置调节
    QString dis_intensityAdjustment;//强度调节
    QString dis_confirm;//按 \" 确认\" 设置为建议值
    QString dis_prompt;//提示

    int db_currentCount;
    DBKEY db_currentModel;
    bool my_alarmEnable;
    bool my_bgTransparent;



    
};

#endif // MYDISPLAYWIDGET_H
